package ui.mainscreen.listeners;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import ui.ScreenPanelManager;
import ui.ScreenPanelManager.ID;
import ui.mainscreen.LoadPanel;
import ui.mainscreen.MenuPanel;
import ui.mainscreen.MainScreenPanel;

/**
 * Слушатель нажатий кнопки Загрузки
 * 
 * @author Anton
 */
public class LoadButtonListener implements ActionListener {

	private LoadPanel load;
	private MenuPanel menuPanel;
	private MainScreenPanel mainScreenPanel;

	public LoadButtonListener(LoadPanel load, MenuPanel menuPanel, MainScreenPanel mainScreenPanel) {
		this.load = load;
		this.menuPanel = menuPanel;
		this.mainScreenPanel =mainScreenPanel;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		mainScreenPanel.add(load);
		load.setVisible(true);

		mainScreenPanel.revalidate();

		menuPanel.menuCreatorButton.setEnabled(false);
		menuPanel.menuOptionButton.setEnabled(false);
		menuPanel.menuNewButton.setEnabled(false);
		menuPanel.menuExitButton.setEnabled(false);
		menuPanel.menuLoadButton.setEnabled(false);

	}

}
